import Vue from 'vue'
import App from './App'
import store from '@/store/index'
import {fly} from '@/utils/fly'

let AV = require('leancloud-storage/live-query')
AV.init('wDkIzAKv85CKMtI4ETMLrkn3-gzGzoHsz','CIG6q5wtFNYGexACqGWVEhla')
//一方早餐
// AV.init('91TtjFpYIeeLfxTlfYAo9GLT-gzGzoHsz','lLxPT0gKqEBd2Vk56OCjYfbp') 
console.log('init', AV);

Vue.config.productionTip = false
App.mpType = 'app'

Vue.prototype.$store = store // 挂载store
Vue.prototype.$showToast = wx.showToast

Vue.prototype.$http = fly

import OIcon from '@/components/oui/icon.vue'

Vue.component('o-icon',OIcon)

Vue.filter('formateDate',function(str) {
  return ''
  if (!str) return ''
  let date = new Date(str)
  let fullZero = flag=> flag>9?flag:'0'+flag
  str = `${date.getFullYear()}-${fullZero(date.getMonth()+1)}-${fullZero(date.getDate())} ${fullZero(date.getHours())}:${fullZero(date.getMinutes())}:${fullZero(date.getSeconds())}`
  // 2019-01-14 13:48:17
  return str
})

const app = new Vue(App)
app.$mount()
